﻿using System.Data.SqlClient;
using DataAccess;

namespace Business
{
    public class TownBusiness
    {
        /// <summary>
        /// Gets the instance.
        /// </summary>
        /// <value>
        /// The instance.
        /// </value>
        public static TownBusiness Instance { get; private set; }

        /// <summary>
        /// Initializes the <see cref="AddressBusiness" /> class.
        /// </summary>
        static TownBusiness() { Instance = new TownBusiness(); }


        /// <summary>
        /// Gets the town.
        /// </summary>
        /// <param name="townId">The town id.</param>
        /// <returns></returns>
        public Entities.Town GetTown(string townId)
        {
            try
            {
                if (!string.IsNullOrEmpty(townId))
                    return TownDataAccess.Instance.GetTown(townId);
                return null;
            }
            catch (SqlException)
            {


                return null;
            }

        }

    }
}

